#ubuntu的内核源码树，如果要编译在ubuntu中安装的模块就打开这2个
#KERN_VER = $(shell uname -r)
#KERN_DIR = /lib/modules/$(KERN_VER)/build	

		
# 开发板的linux内核的源码树目录
# KERN_DIR = /opt/project/rockchip/forlinx/OK3568_Linux_5-10/kernel
KERN_DIR = /opt/project/rockchip/forlinx/OK3568_Linux_4-19/kernel
# KERN_DIR = /opt/project/rockchip/atom/atk-dlrk3506_linux6.1/kernel
# obj-m	+= cl1026-sample.o
obj-m	+= cl1026.o
PWD?=$(shell pwd)
ARCH=arm64
# ARCH=arm
# GCC=/opt/project/rockchip/forlinx/OK3568_Linux_5-10/prebuilts/gcc/linux-x86/aarch64/gcc-arm-10.3-2021.07-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-
GCC=/opt/project/rockchip/forlinx/OK3568_Linux_4-19/prebuilts/gcc/linux-x86/aarch64/gcc-linaro-6.3.1-2017.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
# GCC=/opt/project/rockchip/atom/atk-dlrk3506_linux6.1/prebuilts/gcc/linux-x86/arm/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
all:
	make -C $(KERN_DIR) CROSS_COMPILE=$(GCC) ARCH=$(ARCH) M=$(PWD) modules
	
.PHONY: clean	
clean:
	make -C $(KERN_DIR)  CROSS_COMPILE=$(GCC) ARCH=$(ARCH) M=$(PWD) modules clean
